package dd.control;

import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

import xml.Message;
import dd.model.Event;
import dd.model.Model;

public class ConnectController {
	/**
	 * once we connected
	 * we need to record the id as client id(I didn't know if this id is useful)
	 */

	public void process(Message response){
		//get the client id
		Node update = response.contents.getFirstChild();
		NamedNodeMap map = update.getAttributes();
		String thisid = map.getNamedItem("id").getNodeValue();
		System.out.println("receivedid:" + thisid);
		//save the client id
		Model model = Model.getInstance();
		Event e = model.getEvent();
		e.setEventID(thisid);
	}
}
